TARGET_NAME=rapport

# can add : pdflatex -interaction=batchmode


all: $(TARGET_NAME)
	pdflatex -output-directory build -halt-on-error -file-line-error -halt-on-error $(TARGET_NAME).tex
	mv build/$(TARGET_NAME).pdf .

$(TARGET_NAME): build
	pdflatex -output-directory build -draftmode -halt-on-error -file-line-error $(TARGET_NAME).tex

build:
	mkdir -p build

.PHONY: clean cleanall

clean:
	rm -f build/*.aux build/*.log build/*.nav build/*.out build/*.snm build/*.toc
	$(shell echo "if [ -e build ] ; then rmdir build; fi")

cleanall: clean
	rm -f $(TARGET_NAME).pdf

